<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>${fns:getConfig('productName')}</title>
    <meta name="decorator" content="blank"/>

    <%--<c:set var="tabmode" value="${empty cookie.tabmode.value ? '0' : cookie.tabmode.value}"/>--%>
    <%--<c:if test="${tabmode eq '1'}">--%>
        <%--<link rel="Stylesheet" href="${ctxStatic}/jerichotab/css/jquery.jerichotab.css" />--%>
        <%--<script type="text/javascript" src="${ctxStatic}/jerichotab/js/jquery.jerichotab.js"></script>--%>
    <%--</c:if>--%>

    <!-- 引入自定义文件 -->
    <%--<script src="${ctxStatic}/common/mustache.min.js" type="text/javascript"></script>--%>
    <%--<script src="${ctxStatic}/common/content.js" type="text/javascript"></script>--%>
    <%--<link href="${ctxStatic}/common/css/login.css" type="text/css" rel="stylesheet">--%>
    <%--<script type="text/javascript">var ctx = '${ctx}', ctxStatic='${ctxStatic}';</script>--%>

    <%--<script src="${ctxStatic}/jquery-validation/jQueryValidateExtend.js" type="text/javascript"></script>--%>

    <%--<script src="static/common/inspinia.js?v=3.2.0"></script>--%>
    <script src="static/common/contabs-hplus.js"></script>

    <!-- Pixel Admin's stylesheets -->
    <%--<link href="static/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">--%>
    <%--<link href="static/assets/css/bootstrap-duallistbox.css" rel="stylesheet" />--%>
    <link href="static/assets/css/pixel-admin.min.css" rel="stylesheet" type="text/css">
    <%--<link href="static/assets/css/widgets.min.css" rel="stylesheet" type="text/css">--%>
    <%--<link href="static/assets/css/rtl.min.css" rel="stylesheet" type="text/css">--%>
    <link href="static/assets/css/themes.min.css" rel="stylesheet" type="text/css">
    <%--<link href="static/assets/css/grid/openplat.css" rel="stylesheet">--%>
    <link href="static/assets/css/jquery/jquery.webui-popover.min.css" rel="stylesheet">
    <%--<link href="static/assets/css/morris/morris.css" rel="stylesheet">--%>
    <%--<link href="static/assets/js/bootstrap-fileinput/css/fileinput.min.css" rel="stylesheet" />--%>


    <style>
        .sgrid table tr {
            height: 36px
        }

        .z-loading-wrap {
            overflow: hidden;
            position: absolute;
            top: 45%;
            left: 50%;
            z-index: 1000;
            width: 100px;
            height: 100px;
            display: none;
            margin-left: -50px;
        }

        .z-loading-wrap img {
            width: 60px;
            height: 60px;
        }
    </style>

    <script type="text/javascript">
        // 影藏popover
        function hideJwpopover() {
            $('.jwpopover').each(function(index, obj) {
                $(obj).webuiPopover('hide');
            });
        }
        $.ajaxSetup({
            beforeSend: function(XMLHttpRequest) {
                hideJwpopover();
            }
        });
        $(function() {

            // $("body").addClass("theme-purple-hills main-menu-animated");

            $(document).ajaxStart(function() {　　　　
                $(".z-loading-wrap").show();　
            });

            $(document).ajaxComplete(function() {
                setTimeout(function() {
                    $(".z-loading-wrap").hide();
                }, 500) //3000是表示3秒后执行隐藏代码

            });
        });
    </script>

    <%--<script src="static/assets/js/bootstrap.min.js"></script>--%>
    <script src="static/assets/js/jquery.bootstrap-duallistbox.js"></script>
    <script src="static/assets/js/jquery/jquery.webui-popover.js"></script>
    <script src="static/assets/js/grid/spagination.js"></script>
    <script src="static/assets/js/grid/sgrid.js"></script>
    <script src="static/assets/js/grid/model.js"></script>
    <script src="static/assets/js/grid/utils.js"></script>
    <script src="static/assets/js/util/JsUtil.js"></script>
    <script src="static/assets/js/util/form.js"></script>
    <!-- Pixel Admin's javascripts -->
    <script src="static/assets/js/pixel-admin.min.js"></script>
    <script src="static/assets/js/quote.js"></script>
    <script src="static/assets/js/morris/raphael-min.js"></script>
    <script src="static/assets/js/morris/morris.min.js"></script>
    <script src="static/assets/js/util/ajaxupload.3.6.js"></script>
    <script src="static/assets/js/util/imgbox.js"></script>
    <script src="static/assets/js/util/md5.js"></script>
    <%--<script src="static/assets/js/bootstrap-fileinput/js/fileinput.min.js"></script>--%>
    <%--<script src="static/assets/js/bootstrap-fileinput/js/fileinput_locale_zh.js"></script>--%>
    <%--<script src="static/assets/js/ueditor/ueditor.config.js" type="text/javascript"></script>--%>
    <%--<script src="static/assets/js/ueditor/ueditor.all.min.js" type="text/javascript"></script>--%>
    <%--<script src="static/assets/js/ueditor/lang/zh-cn/zh-cn.js" type="text/javascript"></script>--%>

    <script>
        var _urlPath = "static/";
    </script>


    <style type="text/css">
        #iconview {
            display: none;
        }

        #imgview {
            display: none;
        }

        .form-group {
            margin-bottom: unset;
        }
    </style>
</head>
<body class="theme-frost main-menu-animated">
<div class="z-loading-wrap">
    <div class="spinner">
        <img src="static/assets/images/loading2.gif" />
    </div>
    <div class="z-msg">拼命加载中...</div>
</div>
<script>
    var init = [];
    /* var operations = [

    ]; */
    //var operations = [<#list operations as operation><#if operation_index != 0>,</#if>''</#list>];
</script>
<script src="static/assets/demo/demo.js"></script>
<script src="static/assets/js/util/lunarUtil.js"></script>
<script src="static/assets/js/util/Util.js"></script>
<div id="main-wrapper" style="vertical-align: unset;">
    <div id="main-navbar" class="navbar navbar-inverse" role="navigation">
        <button type="button" id="main-menu-toggle">
            <i class="navbar-icon fa fa-bars icon"></i><span class="hide-menu-text">隐藏菜单</span>
        </button>
        <div class="navbar-inner">
            <div class="navbar-header">
                <a href="${ctx}/home" target="iframe0" class="navbar-brand" style="font-size: 20px;">${fns:getConfig('productName')}</a>
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-navbar-collapse">
                    <i class="navbar-icon fa fa-bars"></i>
                </button>
            </div>
            <div id="main-navbar-collapse" class="collapse navbar-collapse main-navbar-collapse">
                <div>
                    <ul class="nav navbar-nav" id="menu" style="*white-space: nowrap;">
                        <li class="menu active">
                            <a class="menu" href="javascript:" data-href="/a/sys/menu/tree?parentId=27" data-id="27"><span>我的桌面</span></a>
                        </li>
                        <li class="menu">
                            <a class="menu" href="javascript:" data-href="/a/sys/menu/tree?parentId=2" data-id="2"><span>系统设置</span></a>
                        </li>
                    </ul>
                    <div class="right clearfix">
                        <ul class="nav navbar-nav pull-right right-navbar-nav">
                            <%--<li><a href="${ctx}/iim/myCalendar" target="iframe0"><i class="ace-icon fa fa-calendar icon-animated-calendar"></i><span>日程</span></a></li>--%>
                            <li class="purple">
                                <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                    <i class="ace-icon fa fa-bell icon-animated-bell"></i><span>通知</span>
                                    <span class="badge badge-important">0</span>
                                </a>
                                <ul class="dropdown-menu-right dropdown-navbar navbar-pink dropdown-menu dropdown-caret dropdown-close">
                                    <li class="dropdown-header">
                                        <i class="ace-icon fa fa-exclamation-triangle"></i> 0 未读消息
                                    </li>
                                    <li class="dropdown-content">
                                        <ul class="dropdown-menu dropdown-navbar navbar-pink">
                                        </ul>
                                    </li>
                                    <li class="dropdown-footer">
                                        <a class="J_menuItem" href="${ctx}/oa/oaNotify/self" target="iframe0">
                                            查看所有
                                            <i class="ace-icon fa fa-arrow-right"></i>
                                        </a>
                                    </li>
                                </ul>
                            </li>
                            <%--<li class="green">--%>
                                <%--<a data-toggle="dropdown" class="dropdown-toggle" href="#">--%>
                                    <%--<i class="ace-icon fa fa-envelope icon-animated-vertical"></i><span>邮件</span>--%>
                                    <%--<span class="badge badge-success">0</span>--%>
                                <%--</a>--%>
                                <%--<ul class="dropdown-menu-right dropdown-navbar dropdown-menu dropdown-caret dropdown-close">--%>
                                    <%--<li class="dropdown-header">--%>
                                        <%--<i class="ace-icon fa fa-envelope-o"></i> 0 未读邮件--%>
                                    <%--</li>--%>
                                    <%--<li class="dropdown-content">--%>
                                        <%--<ul class="dropdown-menu dropdown-navbar">--%>
                                        <%--</ul>--%>
                                    <%--</li>--%>
                                    <%--<li class="dropdown-footer">--%>
                                        <%--<a class="J_menuItem" href="${ctx}/iim/mailBox/list?orderBy=sendtime desc" target="iframe0">--%>
                                            <%--查看所有邮件<i class="ace-icon fa fa-arrow-right"></i>--%>
                                        <%--</a>--%>
                                    <%--</li>--%>
                                <%--</ul>--%>
                            <%--</li>--%>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle user-menu" data-toggle="dropdown" id="showHeadImg">

                                    <img src="static/userfiles/8/images/WechatIMG162.jpeg" alt="">

                                    <span>${fns:getUser().name}</span>
                                    <i class="fa fa-caret-down"></i>
                                </a>
                                <ul class="dropdown-menu">
                                    <li>
                                        <a class="J_menuItem" href="${ctx}/sys/user/imageEdit" target="iframe0"><i class="ace-icon fa fa-cog"></i>&nbsp;&nbsp;修改头像</a>
                                    </li>
                                    <li>
                                        <a class="J_menuItem" href="${ctx}/sys/user/info" target="iframe0"><i class="ace-icon fa fa-user"></i>&nbsp;&nbsp;个人资料</a>
                                    </li>
                                    <li>
                                        <a class="J_menuItem" href="${ctx}/sys/user/modifyPwd" target="iframe0"><i class="ace-icon fa fa-lock"></i>&nbsp;&nbsp;更换密码</a>
                                    </li>
                                    <%--<li>--%>
                                        <%--<a class="J_menuItem" href="${ctx}/iim/contact/index" target="iframe0"><i class="ace-icon fa fa-indent"></i>&nbsp;&nbsp;我的通讯录</a>--%>
                                    <%--</li>--%>
                                    <%--<li>--%>
                                        <%--<a class="J_menuItem" href="${ctx}/iim/mailBox/list" target="iframe0"><i class="ace-icon fa fa-inbox"></i>&nbsp;&nbsp;信箱</a>--%>
                                    <%--</li>--%>
                                    <li class="divider"></li>
                                    <li>
                                        <a href="#" onclick="toShowThemeDiv()"><i class="ace-icon fa fa-share-alt"></i>&nbsp;&nbsp;样式设置</a>
                                    </li>
                                    <%--<li>--%>
                                        <%--<a href="#" onclick="changeStyle()"><i class="ace-icon fa  fa-mail-reply"></i>&nbsp;&nbsp;切换到ACE模式</a>--%>
                                    <%--</li>--%>
                                    <li class="divider"></li>
                                    <li>
                                        <a class="J_menuItem" href="#" onclick="logout();"><i class="ace-icon fa fa-power-off"></i>&nbsp;&nbsp;安全退出</a>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="main-menu" role="navigation">
        <div id="main-menu-inner">
            <div class="menu-content top" id="menu-content-demo">
                <div>
                    <div class="text-bg"><span class="text-semibold">${fns:getUser().name}</span></div>
                    <img src="static/userfiles/8/images/WechatIMG162.jpeg" alt="">
                    <div class="btn-group">
                        <a href="${ctx}/sys/user/info.html" target="iframe0" data-original-title="个人设置" class="btn btn-xs btn-primary btn-outline dark add-tooltip"><i class="fa fa-cog"></i></a>
                        <a href="javascript:logout()" data-original-title="退出" class="btn btn-xs btn-danger btn-outline dark add-tooltip"><i class="fa fa-power-off"></i></a>
                        <a href="${ctx}/home" target="iframe0" data-original-title="主页" class="btn btn-xs btn-danger btn-outline dark add-tooltip"><i class="fa fa-home fa-fw"></i></a>
                    </div>
                    <a href="#" class="close">&times;</a>
                </div>
            </div>
            <div id="left">
                <script type="text/javascript">
                    $(document).ready(function() {
                        $(".mm-dropdown a").click(function() {
                            $(".active").removeClass("active");
                            $(this).parent().addClass("active");

                        });

                        $('.navigation > .mm-dropdown').hover(function() {
                            $(this).addClass("mm-dropdown-root");
                        }, function() {
                            $(this).removeClass("mm-dropdown-root");
                        });
                    });
                </script>
                <ul class="navigation">

                </ul>
            </div>
        </div>
    </div>
    <div class="row J_mainContent" id="content-main" style="margin-top: 38px;">
        <iframe class="J_iframe" name="iframe0" id="iframe0" width="100%" height="100%" src="${ctx}/sys/user/info" frameborder="0" data-id="${ctx}/home" seamless></iframe>
    </div>
    <div id="main-menu-bg"></div>
</div>

<script type="text/javascript">
    $(document).ready(function() {
        $(".z-loading-wrap").show();
        // 绑定菜单单击事件
        $("#menu a.menu").click(function() {
            // 一级菜单焦点
            $("#menu li.menu").removeClass("active");
            $(this).parent().addClass("active");

            /* // 左侧区域隐藏
            if ($(this).attr("target") == "mainFrame") {
                $("#left,#openClose").hide();
                wSizeWidth();
                //
                return true;
            }
            // 左侧区域显示
            $("#left,#openClose").show();
            if (!$("#openClose").hasClass("close")) {
                $("#openClose").click();
            } */
            // 显示二级菜单
            var menuId = "#menu-" + $(this).attr("data-id");
            // debugger;
            $.get($(this).attr("data-href"),
                function(data) {
                    if (data.indexOf("id=\"loginForm\"") != -1) {
                        alert('未登录或登录超时。请重新登录，谢谢！');
                        top.location = "${ctx}";
                        return false;
                    }
                    $("#left").html('');
                    $("#left").append(data);
                    // 链接去掉虚框
                    $(menuId + " a").bind("focus",
                        function() {
                            if (this.blur) {
                                this.blur()
                            };
                        });
                    // 默认选中第一个菜单
                    $("#left ul a:first").click();
                    $("#left ul li:first li:first a:first ").click();
                });
            return;
            if ($(menuId).length > 0) {
                $("#left ul").addClass("hide");
                $(menuId).next("ul").find("ul").each(function() {
                    if ($(this).css('display') == "block") {
                        $(this).css('display', 'none');
                    }
                });
                $(menuId).next("ul").removeClass("hide");



                // 初始化点击第一个二级菜单
                /* // 二级标题
			$(menuId + " .accordion-heading a").click(function(){
				$(menuId + " .accordion-toggle i").removeClass('icon-chevron-down').addClass('icon-chevron-right');
				if(!$($(this).attr('data-href')).hasClass('in')){
					$(this).children("i").removeClass('icon-chevron-right').addClass('icon-chevron-down');
				}
			});
			// 二级内容
			$(menuId + " .accordion-body a").click(function(){
				$(menuId + " li").removeClass("active");
				$(menuId + " li i").removeClass("icon-white");
				$(this).parent().addClass("active");
				$(this).children("i").addClass("icon-white");
			});
			// 展现三级
			$(menuId + " .accordion-inner a").click(function(){
				var href = $(this).attr("data-href");
				if($(href).length > 0){
					$(href).toggle().parent().toggle();
					return false;
				}
				//
			}); */
            } else {
                // 获取二级菜单数据
                $.get($(this).attr("data-href"),
                    function(data) {
                        if (data.indexOf("id=\"loginForm\"") != -1) {
                            alert('未登录或登录超时。请重新登录，谢谢！');
                            top.location = "${ctx}";
                            return false;
                        }
                        $("#left ul").addClass("hide");
                        $("#left").append(data);
                        // 链接去掉虚框
                        $(menuId + " a").bind("focus",
                            function() {
                                if (this.blur) {
                                    this.blur()
                                };
                            });
                    });
            }
            // 大小宽度调整
            return false;
        });
        // 初始化点击第一个一级菜单
        $("#menu a.menu:first span").click();
    });

    function setCookie(name, value) {
        var Days = 30;
        var exp = new Date();
        exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
        document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
    }
    //读取cookies
    function getCookie(name) {
        var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");

        if (arr = document.cookie.match(reg))
            return unescape(arr[2]);
        else
            return null;
    }

    function getSysTheme() {
        var h_theme_name = getCookie("h_theme_name");
        if (h_theme_name != null) {
            $("body").attr("class", "");
            $("body").addClass(h_theme_name);
        } else {
            $("body").attr("class", "");
            // 给body 加上class
            // $("body").addClass("theme-frost main-menu-animated");
            $("body").addClass("theme-white main-menu-animated");
        }
    }

    function setSysTheme(themeName) {
        var theme = "theme-" + themeName + " main-menu-animated";

        $("body").attr("class", "");
        $("body").addClass(theme);
        setCookie("h_theme_name", theme);
    }
    //获取cookie保存的样式
    getSysTheme();

    function setCwinHeight() {

        var iframeid = document.getElementById("iframe0"); //iframe id
        var hashH = document.documentElement.scrollHeight;
        iframeid.height = hashH - 38;
    }
    setCwinHeight();

    function changeStyle() {
        $.get('/theme/ace?url=' + window.top.location.href, function(result) { window.location.reload(); });
    }

    init.push(function() {

    });
    window.PixelAdmin.start(init);

    /* $(function(){
        enterSubmitForm("searchForm", formSubmit);
        $("li", ".navigation").each(function(index, obj){
           var opCode = $(obj).attr("opCode");
           if(opCode && opCode != undefined) {
              // æƒé™åˆ—è¡¨ä¸­æ²¡æœ‰è¯¥æƒé™
              if ($.inArray(opCode, operations) == -1){
                  $(obj).remove();
              };
           }
        });
    }); */

    function goIndex() {
        window.location.href = "${ctx}/login";
    }

    $(function() {
        $('.mm-dropdown li').bind('click', function() {
            $('.mm-dropdown li').removeClass('active');
            $('.mmc-dropdown-delay li').removeClass('active');
            $(this).addClass('active');
        });
        $('.add-tooltip').tooltip();
    });

    function logout() {
        $.Cfm("确定注销登录?", function() {
            window.location.href = "${ctx}/logout";
        });
    }

    function index() {
        window.open("druid/login.html");
    }

    /*
    var headBtn = $("#headBtn");
	new AjaxUpload(headBtn,{
		action: _urlPath+"/admin/uploadPic?type=1&id=" + ,
		name: "picfile",
		responseType: "json",
		onSubmit: function(file,ext){
			if (!(ext && /^(jpg|png|jpeg|gif)$/.test(ext))){
                modalErr("è¯·é€‰æ‹©å›¾ç‰‡æ ¼å¼æ–‡ä»¶");
				return false;
			}
			headBtn.text('å¤´åƒä¸Šä¼ ä¸­...');
		},
		onComplete: function(file,response){
			if("S" == response.status){
				//goIndex();
			}
		}
	});
	*/

    function toShowThemeDiv() {
        //$("#demo-settings-toggler").addClass("hide");
        //$("#demo-settings-toggler").removeClass("hide");
        $('#demo-settings').toggleClass('open');
        return false;
    }
</script>

<style>
    /*签名样式*/

    .layim-sign-box {
        width: 95%
    }

    .layim-sign-hide {
        border: none;
        background-color: #F5F5F5;
    }
</style>

</body>
</html>